﻿//天地图服务
function TiandituMapService(layerInfo) {
    var TiandituMapService = new Object;
    TiandituMapService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    TiandituMapService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    TiandituMapService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    TiandituMapService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    TiandituMapService.title = layerInfo.hasOwnProperty("TITLE") ? layerInfo.TITLE : "";
    TiandituMapService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var title = this.title;
        var thisLayer = new ol.layer.Tile({
            title: title,
            source: new ol.source.XYZ({
                url: url,
                name: name,
                id:id
            })
        });
        return thisLayer;
    }
    return TiandituMapService;
}